<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="../vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<child :level="level">
				 hello world 
			</child>	
		</div>
	</body>
</html>

<script type="text/javascript">
	const child = {
		props: ['level'],
		render(createElement) {
			return createElement(
				'h'+this.level,
				// this.$slots.default是父组件传过来的内容
				this.$slots.default
			)
		}
	}
	
	new Vue({
		el: '#app',
		data: {
			level: 2
		},
		components: {
			child
		}
	})
	
	
	
</script>
